/**
 * @name: index
 * @author: zhangYuanTao
 * @date: 2021-07-14 16:04
 * @description：路由
 * @update: 2021-07-14 16:04
 */
import React from 'react';
import { Redirect } from "react-router-dom"
import ZYTDiscover from "@/pages/discover";
import ZYTMine from '@/pages/mine';
import ZYTFriend from '@/pages/friend';
import ZYTPalyer from "@/pages/palyer";
import ZYTRecomment from "../pages/discover/c-pages/recommend";
import ZYTRanking from "../pages/discover/c-pages/ranking";
import ZYTSongs from "../pages/discover/c-pages/songs";
import ZYTDjradio from "../pages/discover/c-pages/djradio";
import ZYTArtist from "../pages/discover/c-pages/artist";
import ZYTAlbum from "../pages/discover/c-pages/album";

const routers = [
  {
    path: '/',
    exact: true,
    render: () => (
      <Redirect to="/discover" />
    )
  },
  {
    path: '/discover',
    component: ZYTDiscover,
    routes: [
      {
        path: "/discover",
        exact: true,
        render: () => (
          <Redirect to="/discover/recommend" />
        )
      },
      {
        path: "/discover/recommend",
        component: ZYTRecomment
      },
      {
        path: "/discover/ranking",
        component: ZYTRanking
      },
      {
        path: "/discover/songs",
        component: ZYTSongs
      },
      {
        path: "/discover/djradio",
        exact: true,
        component: ZYTDjradio
      },
      {
        path: "/discover/artist",
        component: ZYTArtist
      },
      {
        path: "/discover/album",
        component: ZYTAlbum
      }
    ]

  },
  {
    path: '/discover',
    component: ZYTDiscover
  },
  {
    path: '/mine',
    component: ZYTMine
  },
  {
    path: '/friend',
    component: ZYTFriend
  },
  {
    path: '/palyer',
    component: ZYTPalyer
  },

]

export default routers;
